package com.minimalist.common.entity.lindi.po;

import com.minimalist.common.config.mybatis.InsertFullColumnHandler;
import com.minimalist.common.config.mybatis.UpdateFullColumnHandler;
import com.minimalist.common.config.mybatis.bo.BaseEntity;
import com.mybatisflex.annotation.Table;

import java.io.Serial;
import java.io.Serializable;
import java.util.Objects;

/**
 * 林地指标交易平台_补贴申请文件 实体类。
 *
 * @author 11987
 * @since 2025-06-09
 */
@Table(value = "LINDI_SUBSIDY_APPLICATION_FILE", onInsert = InsertFullColumnHandler.class, onUpdate = UpdateFullColumnHandler.class)
public class LindiSubsidyApplicationFile extends BaseEntity implements Serializable{

    @Serial
    private static final long serialVersionUID = 1L;

    /**
     * 补贴申请ID
     */
    private Long subsidyApplicationId;

    /**
     * 文件ID
     */
    private Long fileId;

    /**
     * 文件类型
     */
    private String fileType;

    // 无参构造函数
    public LindiSubsidyApplicationFile() {
        super();
    }

    // 全参构造函数
    public LindiSubsidyApplicationFile(Long subsidyApplicationId, Long fileId, String fileType) {
        super();
        this.subsidyApplicationId = subsidyApplicationId;
        this.fileId = fileId;
        this.fileType = fileType;
    }

    // Getter和Setter方法
    public Long getSubsidyApplicationId() {
        return subsidyApplicationId;
    }

    public void setSubsidyApplicationId(Long subsidyApplicationId) {
        this.subsidyApplicationId = subsidyApplicationId;
    }

    public Long getFileId() {
        return fileId;
    }

    public void setFileId(Long fileId) {
        this.fileId = fileId;
    }

    public String getFileType() {
        return fileType;
    }

    public void setFileType(String fileType) {
        this.fileType = fileType;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        if (!super.equals(o)) return false;
        LindiSubsidyApplicationFile that = (LindiSubsidyApplicationFile) o;
        return Objects.equals(subsidyApplicationId, that.subsidyApplicationId) &&
               Objects.equals(fileId, that.fileId) &&
               Objects.equals(fileType, that.fileType);
    }

    @Override
    public int hashCode() {
        return Objects.hash(super.hashCode(), subsidyApplicationId, fileId, fileType);
    }

    @Override
    public String toString() {
        return "LindiSubsidyApplicationFile{" +
                "subsidyApplicationId=" + subsidyApplicationId +
                ", fileId=" + fileId +
                ", fileType='" + fileType + '\'' +
                "} " + super.toString();
    }

    // Builder类
    public static class Builder {
        private Long subsidyApplicationId;
        private Long fileId;
        private String fileType;

        public Builder subsidyApplicationId(Long subsidyApplicationId) {
            this.subsidyApplicationId = subsidyApplicationId;
            return this;
        }

        public Builder fileId(Long fileId) {
            this.fileId = fileId;
            return this;
        }

        public Builder fileType(String fileType) {
            this.fileType = fileType;
            return this;
        }

        public LindiSubsidyApplicationFile build() {
            return new LindiSubsidyApplicationFile(subsidyApplicationId, fileId, fileType);
        }
    }

    public static Builder builder() {
        return new Builder();
    }

}
